<%-- 
    Document   : index
    Created on : 22-mar-2014, 14:51:45
    Author     : Desarrollador
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="DAO.datUsuario"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <br/>
        <br/>
        <h3 align="center">Acceso a Sistema sssss</h3>
        <br/>
        <form>
            <table align="center" border="1">

                <tr><td> Usuario</td>
                    <td><input type="text" name="txtUsuario"/></td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td><input type="Password" name="txtpassword"/></td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" name="btnIngresar" value="Ingresar"/>
                    </td>

                </tr>
            </table>
        </form>  
        <%
            if(request.getParameter("btnIngresar")!=null){
                int Veri = 0;
                Veri = datUsuario.VerificarAcceso(
                                      request.getParameter("txtUsuario"),
                                      request.getParameter("txtPassword"));
                if(Veri>0){
                    response.sendRedirect("frmPrincipal.jsp");
            }
                else{
                    out.print("<script>alert('Usuario o Password no valido')</script>");
                }
            }
        %>
    </body>
</html>
